package com.vr.rule.controller;

import com.vr.tool.api.R;
import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.flow.LiteflowResponse;
import com.yomahub.liteflow.slot.DefaultContext;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description TODO
 * @Author kenson
 * @Date 2024/11/7 12:19
 */
@RestController
@RequestMapping("/rule")
public class RuleController {
    @Resource
    private FlowExecutor flowExecutor;


    @PostMapping("/test")
    public Object get(){
        LiteflowResponse response = flowExecutor.execute2Resp("chain7", "asd");
        DefaultContext firstContextBean = response.getFirstContextBean();
        Object status = firstContextBean.getData("status");
        return status;
    }



}



